import time

from selenium import webdriver
import pytest
from page.page3 import Page3


@pytest.fixture(scope='function')
def driver():
    driver = webdriver.Edge()
    driver.maximize_window()
    driver.implicitly_wait(10)
    yield driver
    driver.close()
    driver.quit()


def test_01(driver):
    po = Page3(driver)
    po.url_loc()
    time.sleep(5)
    po.dy_loc()
    assert "百度一下" == po.dy_loc()
    print(po.dy_loc())
    po.input_loc()
    po.dianji_loc()
    po.dy1_loc()
    print(po.dy1_loc())
    assert '我喜欢软件测试' in po.dy1_loc()
    po.goto()
    po.fan_loc()
    print(po.dy2_loc())
    assert '我喜欢软件测试' in po.dy2_loc()

